package cn.wu.reggie.controller;

import cn.wu.reggie.service.AddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("addr")
public class AddrController {

    @Autowired
    AddrService addrService;

    @GetMapping("findAllProvices")
    public List findAllProvices(){
        return addrService.findAllProvinces();
    }

    @GetMapping("findCitiesByPid")
    public List findCitiesByPid(Integer pid){
        return addrService.findCitiesByPid(pid);
    }

    @PostMapping("save")
    public String save(@RequestBody Map map){
        System.out.println(map);
        return "success";
    }
}